<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="../common/base_body_header.jsp" %>
<%@include file="../common/navbar.jsp" %>
<%@include file="../common/page_content_pre.jsp" %>

<link rel="stylesheet" href="${GLOBAL.staticJsPath}/assets/qiniu/fileupload.css"/>

<div class="page-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="widget-box">
                <div class="widget-header">
                    <h4>新楼盘详情</h4>
                </div>
                <div class="widget-body">
                    <div class="widget-main no-padding">
                        <form:form class="form-horizontal" modelAttribute="newProject">
                            <fieldset>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">区域：</label>

                                    <div class="col-sm-4">
                                        <form:select class="input-xlarge" path="district" disabled="true">
                                            <c:forEach items="${fns:getDictList('district')}" var="item">
                                                <option value="${item.name}" <c:if test="${item.name == newProject.district}">selected</c:if>>${item.value}</option>
                                            </c:forEach>
                                        </form:select>
                                    </div>
                                </div>
                            </fieldset>

                            <fieldset>
                                <div class="form-group">
                                    <span class="col-sm-3 control-label">楼盘名称：</span>
                                    <label class="control-label">${newProject.projectName}</label>
                                </div>
                            </fieldset>

                            <fieldset>
                                <div class="form-group">
                                    <span class="col-sm-3 control-label">楼盘地址：</span>
                                    <label class="control-label">${newProject.address}</label>
                                </div>
                            </fieldset>
                            <hr>
                            <div class="form-group">
                                <label class="col-sm-3 control-label"><h4>楼盘基本信息</h4></label>
                            </div>

                            <fieldset>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"></label>

                                    <div class="col-sm-5">
                                        <table>
                                            <tr>
                                                <td style="width: 60px"><label>价格: </label></td>
                                                <td>
                                                    <label>${newProject.priceBottom}</label>
                                                </td>
                                                <td>到</td>
                                                <td>
                                                    <label>${newProject.priceTop}</label>
                                                </td>
                                            </tr>
                                        </table>
                                    </div>
                                </div>
                            </fieldset>

                            <fieldset>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"></label>

                                    <div class="col-sm-5">
                                        <table>
                                            <tr>
                                                <td style="width: 60px"><label>面积: </label></td>
                                                <td>
                                                    <label>${newProject.areaBottom}</label>
                                                </td>
                                                <td>到</td>
                                                <td>
                                                    <label>${newProject.areaTop}</label>
                                                </td>
                                            </tr>
                                        </table>
                                    </div>
                                </div>
                            </fieldset>

                            <fieldset>
                                <div class="form-group">
                                    <span class="col-sm-3 control-label">开盘时间：</span>
                                    <label class="control-label"><fmt:formatDate value='${newProject.openingDate}' pattern='yyyy-MM-dd'/></label>
                                </div>
                            </fieldset>

                            <fieldset>
                                <div class="form-group">
                                    <span class="col-sm-3 control-label">交房时间：</span>
                                    <label class="control-label"><fmt:formatDate value='${newProject.executeDate}' pattern='yyyy-MM-dd'/></label>
                                </div>
                            </fieldset>

                            <fieldset>
                                <div class="form-group">
                                    <span class="col-sm-3 control-label">占地面积：</span>
                                    <label class="control-label">${newProject.totalArea}</label>
                                </div>
                            </fieldset>

                            <fieldset>
                                <div class="form-group">
                                    <span class="col-sm-3 control-label">建筑面积：</span>
                                    <label class="control-label">${newProject.buildArea}</label>
                                </div>
                            </fieldset>

                            <fieldset>
                                <div class="form-group">
                                    <span class="col-sm-3 control-label">总栋数：</span>
                                    <label class="control-label">${newProject.buildingTotal}</label>
                                </div>
                            </fieldset>

                            <fieldset>
                                <div class="form-group">
                                    <span class="col-sm-3 control-label">总户数：</span>
                                    <label class="control-label">${newProject.residenters}</label>
                                </div>
                            </fieldset>

                            <fieldset>
                                <div class="form-group">
                                    <span class="col-sm-3 control-label">绿化率：</span>
                                    <label class="control-label">${newProject.greeningRate}</label>
                                </div>
                            </fieldset>

                            <fieldset>
                                <div class="form-group">
                                    <span class="col-sm-3 control-label">容积率：</span>
                                    <label class="control-label">${newProject.roomRate}</label>
                                </div>
                            </fieldset>

                            <fieldset>
                                <div class="form-group">
                                    <span class="col-sm-3 control-label">开发公司：</span>
                                    <label class="control-label">${newProject.developmentCompany}</label>
                                </div>
                            </fieldset>

                            <fieldset>
                                <div class="form-group">
                                    <span class="col-sm-3 control-label">物业公司：</span>
                                    <label class="control-label">${newProject.propertyManager}</label>
                                </div>
                            </fieldset>

                            <fieldset>
                                <div class="form-group">
                                    <span class="col-sm-3 control-label">物业费：</span>
                                    <label class="control-label">${newProject.propertyFee}</label>
                                </div>
                            </fieldset>

                            <fieldset>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">别墅类别：</label>
                                    <div class="col-sm-5">
                                        <c:forEach items="${fns:getDictList('bs_category')}" var="item">
                                            <c:forEach items="${houseTypeList}" var="categoryItem">
                                                <c:if test="${categoryItem == item.name}">${item.value}&nbsp;;</c:if>
                                            </c:forEach>
                                        </c:forEach>
                                    </div>
                                </div>
                            </fieldset>

                            <fieldset>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">标签：</label>
                                    <div class="col-sm-5">
                                        <c:forEach items="${fns:getDictList('label')}" var="item">
                                            <c:forEach items="${labelList}" var="lableItem">
                                                <c:if test="${lableItem == item.name}">${item.value}&nbsp;;</c:if>
                                            </c:forEach>
                                        </c:forEach>
                                        </div>
                                </div>
                            </fieldset>
                            <fieldset>
                                <div class="form-group">
                                    <span class="col-sm-3 control-label">开盘时间：</span>
                                    <label class="control-label">
                                        <fmt:formatDate value='${newProject.openingDate}' pattern='yyyy-MM-dd'/>
                                    </label>
                                </div>
                            </fieldset>
                            <fieldset>
                                <div class="form-group">
                                    <span class="col-sm-3 control-label">交房时间：</span>
                                    <label class="control-label">
                                        <fmt:formatDate value='${newProject.executeDate}' pattern='yyyy-MM-dd'/>
                                    </label>
                                </div>
                            </fieldset>

                            <fieldset>
                                <div class="form-group">
                                    <span class="col-sm-3 control-label">创建时间：</span>
                                    <label class="control-label">${newProject.createDate}</label>
                                </div>
                            </fieldset>
                            <hr/>
                            <fieldset>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">小区介绍：</label>
                                    ${newProject.text}
                                </div>
                            </fieldset>
                            <hr/>
                            <fieldset>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">效果图：</label>

                                    <div class="col-sm-6">
                                        <div id="photos3" class="row" style="width:750px">
                                            <c:if test="${photoList!= null || fn:length(photoList) == 0}">
                                                <c:forEach items="${photoXGList}" var="item" varStatus="plist">
                                                    <div id="${item.photoUrl}-id" class="col-xs-4"><img
                                                            id="${item.photoUrl}"
                                                            src="${storeUrl}${item.photoUrl}">

                                                        <div class="q-label"><input value="${item.photoDesc}"></div>
                                                    </div>
                                                </c:forEach>
                                            </c:if>
                                        </div>
                                    </div>
                                </div>
                            </fieldset>
                            <hr/>
                            <fieldset>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">实景图：</label>

                                    <div class="col-sm-6">
                                        <div id="photos2" class="row" style="width:750px">
                                            <c:if test="${photoList!= null || fn:length(photoList) == 0}">
                                                <c:forEach items="${photoSJList}" var="item" varStatus="plist">
                                                    <div id="${item.photoUrl}-id" class="col-xs-4"><img
                                                            id="${item.photoUrl}"
                                                            src="${storeUrl}${item.photoUrl}">

                                                        <div class="q-label"><input value="${item.photoDesc}"></div>
                                                    </div>
                                                </c:forEach>
                                            </c:if>
                                        </div>
                                    </div>
                                </div>
                            </fieldset>
                            <hr/>
                            <fieldset>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">交通图：</label>

                                    <div class="col-sm-6">
                                        <div id="photos1" class="row" style="width:750px">
                                            <c:if test="${photoList!= null || fn:length(photoList) == 0}">
                                                <c:forEach items="${photoJTList}" var="item" varStatus="plist">
                                                    <div id="${item.photoUrl}-id" class="col-xs-4"><img
                                                            id="${item.photoUrl}"
                                                            src="${storeUrl}${item.photoUrl}">

                                                        <div class="q-label"><input value="${item.photoDesc}"></div>
                                                    </div>
                                                </c:forEach>
                                            </c:if>
                                        </div>
                                    </div>
                                </div>
                            </fieldset>
                            <hr/>
                            <fieldset>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">户型图：</label>

                                    <div class="col-sm-6">
                                        <div id="photos" class="row" style="width:750px">
                                            <c:if test="${photoList!= null || fn:length(photoList) == 0}">
                                                <c:forEach items="${photoHXList}" var="item" varStatus="plist">
                                                    <div id="${item.photoUrl}-id" class="col-xs-4"><img
                                                            id="${item.photoUrl}"
                                                            src="${storeUrl}${item.photoUrl}">

                                                        <div class="q-label"><input value="${item.photoDesc}"></div>
                                                </c:forEach>
                                            </c:if>
                                        </div>
                                    </div>
                                </div>
                            </fieldset>

                            <fieldset>
                                <label class="col-sm-3 control-label">项目经纪人：</label>

                                <div class="col-sm-5">
                                    <form:select path="userIds" style="width:210px" disabled="true">
                                        <c:forEach items="${users}" var="item">
                                            <c:if test="${item.userId == newProject.userId1}">
                                                <form:option value="${item.userId}" selected = "selected">${item.username}</form:option>
                                            </c:if>
                                            <c:if test="${item.userId != newProject.userId1}">
                                                <form:option value="${item.userId}">${item.username}</form:option>
                                            </c:if>
                                        </c:forEach>
                                    </form:select>
                                </div>
                            </fieldset>

                            <fieldset>
                                <label class="col-sm-3 control-label">项目经纪人：</label>

                                <div class="col-sm-5">
                                    <form:select path="userIds" style="width:210px" disabled="true">
                                        <c:forEach items="${users}" var="item">
                                            <c:if test="${item.userId == newProject.userId2}">
                                                <form:option value="${item.userId}" selected = "selected">${item.username}</form:option>
                                            </c:if>
                                            <c:if test="${item.userId != newProject.userId2}">
                                                <form:option value="${item.userId}">${item.username}</form:option>
                                            </c:if>
                                        </c:forEach>
                                    </form:select>
                                </div>
                            </fieldset>

                            <div class="form-actions center">
                                <button type="button" class="btn btn-sm btn-grey" id="go_back_btn">
                                    返回
                                    <i class="icon-reply icon-on-right bigger-110"></i>
                                </button>
                            </div>
                        </form:form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<%@include file="../common/page_content_suf.jsp" %>
<%@include file="../common/script.jsp" %>

<script type="text/javascript">
    $(document).ready(function () {
        $("#go_back_btn").on("click", function () {
            goBack();
        });
    });

    function goBack() {
        document.location.href = "${GLOBAL.basePath}/newProject/list";
    };
</script>
